using UnityEngine;
using UnityEngine.UI;

namespace Naptime.Buttons
{
	[RequireComponent(typeof(Button))]
	public abstract class BaseActionButton : MonoBehaviour
	{
		private Button _button;

		protected virtual void Awake()
		{
			_button = GetComponent<Button>();
			_button.onClick.AddListener(OnClickCallback);
		}

		protected abstract void OnClickCallback();

		protected virtual void OnDestroy()
		{
			_button.onClick.RemoveListener(OnClickCallback);
		}
	}
}
